from typing import *


class Solution:

    def maxDistToClosest(self, seats: List[int]) -> int:
        ans, l = 0, -1
        n = len(seats)
        for i, v in zip(range(n), seats):
            if v == 1:
                if l == -1:
                    ans = i
                else:
                    ans = max(ans,(i - l)//2)
                l = i
        if seats[-1] == 0:
            ans = max(ans,n - l - 1)
        return ans


# 两个人之间的间隔

# 